]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
dateMenu: Use formatTime() for world clock
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 25 Feb 2015 19:26:08 +0000 (20:26 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 4 Mar 2015 12:55:01 +0000 (13:55 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=745111

js/ui/dateMenu.js

index 76d66fcc3c585af6d283d7b329cdf77ad10f9cd8..cd77c41be8c75d07472f50de46f45cddeccf7452 100644 (file)
@@ -200,23 +200,11 @@ const WorldClocksSection = new Lang.Class({
     },
 
     _updateLabels: function() {
-        let desktopSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.interface' });
-        let clockFormat = desktopSettings.get_string('clock-format');
-        let hasAmPm = new Date().toLocaleFormat('%p') != '';
-
-        let format;
-        if (clockFormat == '24h' || !hasAmPm)
-            /* Translators: Time in 24h format */
-            format = N_("%H\u2236%M");
-        else
-            /* Translators: Time in 12h format */
-            format = N_("%l\u2236%M %p");
-
         for (let i = 0; i < this._locations.length; i++) {
             let l = this._locations[i];
             let tz = GLib.TimeZone.new(l.location.get_timezone().get_tzid());
             let now = GLib.DateTime.new_now(tz);
-            l.actor.text = now.format(format);
+            l.actor.text = Util.formatTime(now, { timeOnly: true });
         }
     }
 });